package biz.datalk.industrialland.admin.modules.system.pojo.dto;

import biz.datalk.industrialland.common.pojo.po.BasePO;
import biz.datalk.industrialland.common.validated.*;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author tarofang@163.com
 * @date 2019-12-27
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
public class SysConfigDTO extends BasePO implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * id
     * <p>
     * sys_config.id
     */
    @EqualsAndHashCode.Include
    @NotNull(groups = {Delete.class, Update.class, Detail.class}, message = "{validations.sys.config.no.exists.or.delete}")
    private Long id;

    /**
     * 系统变量名称
     * <p>
     * sys_config.cfg_name
     */
    @NotBlank(groups = {Insert.class, Update.class}, message = "{validations.sys.config.invalid.blank.cfgName}")
    private String cfgName;

    /**
     * 系统变量Key
     * <p>
     * sys_config.cfg_key
     */
    @NotBlank(groups = {Insert.class, Update.class}, message = "{validations.sys.config.invalid.blank.cfgKey}")
    private String cfgKey;

    /**
     * 系统变量Value
     * <p>
     * sys_config.cfg_value
     */
    @NotNull(groups = {Insert.class, Update.class}, message = "{validations.sys.config.invalid.blank.cfgValue}")
    private String cfgValue;

    /**
     * 说明
     * <p>
     * sys_config.cfg_remark
     */
    private String cfgRemark;

    /**
     * 过期时间(秒) 0 不过期 否则过期
     * <p>
     * sys_config.cfg_expire
     */
    @NotNull(groups = {Insert.class, Update.class}, message = "{validations.sys.config.invalid.blank.cfgExpire}")
    private Integer cfgExpire;

    /**
     * Y-有效 N-无效
     * <p>
     * sys_config.is_valid
     */
    private String isValid;

    /**
     * Y-已删除 N-未删除
     * <p>
     * sys_config.is_delete
     */
    private String isDelete;

    /** 使用逗号隔开 */
    @NotBlank(groups = BatchDelete.class, message = "{validations.sys.config.batch.delete.empty.sysids}")
    private String sysids;
}
